package com.chezhujie.www.service;

import com.chezhujie.www.domain.Shop;
import com.chezhujie.www.persistence.ShopMapper;
import com.sys.core.exception.ClassCheckException;
import com.sys.user.base.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * 店铺信息
 * Created by 汤伟杰 on 2017/5/23.
 */
@Service
public class ShopService extends BaseService<Shop> {
    @Autowired
    private ShopMapper shopMapper;

    @Autowired
    public void setBaseMapper(ShopMapper shopMapper) {
        this.baseMapper = shopMapper;
    }

    public List<Map<String,Object>> getListClassify(Map<String, Object> param) {
        return shopMapper.listClassify(param);
    }
    public List<Map<String,Object>> getListClassType(Map<String, Object> param) {
        return shopMapper.listClassType(param);
    }

    public void checkEntity(Shop shop) throws Exception {
            if(shop.getTitle().length()<50){
                throw new ClassCheckException("店铺信息标题不能超过50个字符");
            }


    }
}
